package com.rstrulak.main;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.rstrulak.dao.TaskDao;
import com.rstrulak.model.Task;

public class Start {

	public static void main(String[] args) {

		ApplicationContext ac = new ClassPathXmlApplicationContext("spring/applicationContext.xml");
//		ContextDao contextDao = (ContextDao) ac.getBean("contextDao");
//		Context byId = contextDao.getById(1l);
//
//		UserManager userManager = (UserManager) ac.getBean("userManager");
//		System.out.println(userManager.getUserByLastName("Kowalski").getFirstName());

		TaskDao taskDao = (TaskDao) ac.getBean("taskDao");
		Task id = taskDao.getById(56l);
		System.out.println(id.getTaskDescription());

//		UserDao userDao = (UserDao) ac.getBean("userDao");
//		System.out.println(userDao.getById(1l).getLogin());
//
//		ProjectDao projectDao = (ProjectDao) ac.getBean("projectDao");
//		System.out.println(projectDao.getById(1l).getDescription());
//
//		System.out.println(byId.getName());
//		((ConfigurableApplicationContext) ac).close();
	}
}
